package fp.poczadly.shared;

import com.google.gwt.user.client.rpc.IsSerializable;

public class Message implements IsSerializable {

	private User from;
	private User to;
	private String body;
	
	public Message() {}
	
	public Message( User user, String body ) {
		this.from = user;
		this.body = body;
	}
	
	public Message( User from, User to, String body ) {
		this( from, body );
		this.setTo( to );
	}

	@Override
	public String toString() {
		return from + ": " + body;
	}

	public User getFrom() {
		return from;
	}

	public void setFrom( User user ) {
		this.from = user;
	}

	public User getTo() {
		return to;
	}

	public void setTo( User to ) {
		this.to = to;
	}

	public String getBody() {
		return body;
	}

	public void setBody( String body ) {
		this.body = body;
	}
	
}
